package com.example.test_20210705_buffer;

import org.apache.catalina.connector.OutputBuffer;

import java.io.*;

public class BufferTest {

    public static void main(String[] args) throws Exception{
        Writer fileWriter = new FileWriter("D:/bk1.xml");
        BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
        BufferedReader bufferedReader = new BufferedReader(new FileReader("D:\\bk.xml"));
        char[] chars = new char[1024];
        int len;
        while ((len = bufferedReader.read(chars)) != -1){
            bufferedWriter.write(chars,0,len);
        }
        bufferedWriter.close();
        bufferedReader.close();
    }

}
